
<template>
    <div class="student">
        <h2>学生姓名：{{ name }}</h2>
        <h2>学生性别：{{ sex }}</h2>
        <button @click="sendStudentName">把学生名给学校</button>
    </div>
</template>

<script>
export default {
    name: "StudentInfo",
    data() {
        return {
            name: "胡桃",
            sex: "女",
        };
    },
    mounted() {
        console.log("Student", this.x);
    },
    methods: {
        sendStudentName() {
            this.$bus.$emit("hello", 666);
        },
    },
};
</script>

<style scoped lang="less">
.student {
    padding: 5px;
    background-color: rgb(247, 151, 218);
}
</style>